import {NativeStackNavigationProp} from '@react-navigation/native-stack';
import {RouteProp} from '@react-navigation/native';

export type RootStackParamList = {
  Login: undefined;
  Home: undefined;
  SearchPage: undefined;
  My: undefined;
  Recommendation: undefined;
  PlayVideo: {id: number}; //示例
  // 新添加的路由及其参数也应该在这里定义
};

//需要用参数的时候需要导出一个 RouteProp
//需要用到页面跳转的时候，需要导出一个StackNavigationProp
//如果两者都需要，就需要导出两个
//import { useNavigation ,useRoute } from '@react-navigation/native'; 目标页面useNavigation是导航，useRoute是route

//定义跳转
export type HomeNavigationProp = NativeStackNavigationProp<
  RootStackParamList,
  'Home'
>;
export type SearchPageNavigationProp = NativeStackNavigationProp<
  RootStackParamList,
  'SearchPage'
>;
export type MyNavigationProp = NativeStackNavigationProp<
  RootStackParamList,
  'My'
>;
export type RecommendationNavigationProp = NativeStackNavigationProp<
  RootStackParamList,
  'Recommendation'
>;
export type PlayVideoNavigationProp = NativeStackNavigationProp<
  RootStackParamList,
  'PlayVideo'
>;
// 定义路由参数类型
export type PlayVideoRouteProp = RouteProp<RootStackParamList, 'PlayVideo'>;
// 更多类型定义...
